<template>
  <view class="container">

    
    <!-- 回购状态 -->
    <view class="status-bar">
      <text>回购状态：</text>
      <text class="status-text status-processing">转账中</text>
    </view>
    
    <!-- 回购详情 -->
    <view class="detail-container">
      <view class="detail-item">
        <text class="detail-label">申请时间：</text>
        <text class="detail-value">2025-05-08 18:37:52</text>
      </view>
      
      <view class="detail-item">
        <text class="detail-label">审核时间：</text>
        <text class="detail-value">2025-05-08 18:38:21</text>
      </view>
      
      <view class="detail-item">
        <text class="detail-label">回购金额：</text>
        <text class="detail-value amount">¥ 300.00</text>
      </view>
      
      <view class="detail-item">
        <text class="detail-label">收款账号：</text>
      </view>
      
      <view class="account-info">
        <view class="account-item">
          <text class="account-label">账户：</text>
          <text class="account-value">江西抽墨科技有限公司</text>
        </view>
        
        <view class="account-item">
          <text class="account-label">账号：</text>
          <text class="account-value">6225 6789 9988 889</text>
        </view>
        
        <view class="account-item">
          <text class="account-label">银行：</text>
          <text class="account-value">中国建设银行</text>
        </view>
        
        <view class="account-item">
          <text class="account-label">开户行：</text>
          <text class="account-value">赣州支行 赣州市</text>
        </view>
        
        <view class="account-item">
          <text class="account-label">开票图片：</text>
        </view>
        
        <view class="image-container">
          <image class="receipt-image" src="/static/images/receipt-placeholder.png" mode="aspectFit"></image>
        </view>
      </view>
    </view>
    
    <!-- 底部空白区域 -->
    <view class="bottom-space"></view>
  </view>
</template>

<script setup>
import { ref } from 'vue';
import { onLoad } from '@dcloudio/uni-app';

// 页面参数
const id = ref('');

// 页面加载
onLoad((options) => {
  if (options.id) {
    id.value = options.id;
    // 根据ID获取回购详情
    getBuybackDetail(options.id);
  }
});

// 获取回购详情
const getBuybackDetail = (id) => {
  // 模拟API请求
  uni.showLoading({
    title: '加载中...'
  });
  
  // 这里应该是实际的API请求
  setTimeout(() => {
    uni.hideLoading();
    // 数据已经在模板中硬编码，实际应该从API获取
  }, 500);
};
</script>

<style>
.container {
  display: flex;
  flex-direction: column;
  min-height: 100vh;
  background-color: #f5f5f5;
}

.header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  height: 44px;
  padding: 0 15px;
  background-color: #00a046;
  color: #fff;
}

.header-title {
  font-size: 16px;
  font-weight: 500;
}

.header-icons {
  display: flex;
  align-items: center;
}

.header-icon {
  margin-right: 15px;
}

.header-icon-circle {
  width: 24px;
  height: 24px;
  border-radius: 50%;
  border: 1px solid #fff;
  display: flex;
  justify-content: center;
  align-items: center;
}

.status-bar {
  display: flex;
  padding: 15px;
  background-color: #fff;
  border-bottom: 1px solid #eee;
}

.status-text {
  font-weight: 500;
}

.status-processing {
  color: #ff9800;
}

.detail-container {
  background-color: #fff;
  padding: 0 15px;
}

.detail-item {
  display: flex;
  padding: 12px 0;
  border-bottom: 1px solid #eee;
}

.detail-label {
  width: 80px;
  color: #666;
  font-size: 14px;
}

.detail-value {
  flex: 1;
  color: #333;
  font-size: 14px;
}

.amount {
  color: #ff6b00;
  font-weight: 500;
}

.account-info {
  padding: 10px 0;
}

.account-item {
  display: flex;
  padding: 8px 0;
}

.account-label {
  width: 70px;
  color: #666;
  font-size: 14px;
}

.account-value {
  flex: 1;
  color: #333;
  font-size: 14px;
}

.image-container {
  padding: 10px 0;
}

.receipt-image {
  width: 100%;
  height: 150px;
  background-color: #f0f0f0;
  border: 1px solid #ddd;
}

.bottom-space {
  height: 50px;
}
</style>
